POV-Ray : Newsgroups : povray.general : Meshes and Textures : Re: Meshes and Textures Server Time
12 Aug 2024 09:25:15 EDT (-0400)
  Re: Meshes and Textures  
From: Gordon
Date: 29 Mar 1999 11:03:21
Message: <36ffa449.0@news.povray.org>
Thanks Ken, but I am not using unions of traingles, but a mesh object. Can
you recast your answer to use meshes? Please don't take this the wrong way,
but I do know about the world origin principle. The fact that the triangles
don't touch isn't relevant. What I am doing is creating a complete mesh
object, each of which has a texture assigned to it. Then I want to use LOTS
of copies of that object. I would assume that like any other object type, if
I make copies and rotate them the texture goes along.

If you render the following, you will see what I mean. The two objects,
declared in the same way, and used in the same way, don't behave the same.
The texture is "stuck" to the object in the case of a cube, in the case of
the mesh, it isn't.

Regards
Gordon

camera {
        location <0, 0, -4>
        look_at  <0, 0,  0>
}

light_source {   // Light1
  <-986.689, 1003.370, -1011.881>
  color rgb <1.000, 1.000, 1.000>
}

#declare T0 =
texture {
        pigment {
                gradient x
                colour_map {
                        [ 0.0 colour rgb <0.15,0.6,0.17>]
                        [ 0.5 colour rgb <1,0.1,0.17>]
                        [ 1.0 colour rgb <0.15,0.6,0.17>]
                        }
                        frequency 5
                }
        finish {
                ambient 0.3
                diffuse 0.65
                phong 0.3
                phong_size 20
                }
        }

#declare Obj = mesh{
        triangle { <0,0,0>, <1,0,0>, <0,1,0> texture{ T0 } }
}

object { Obj translate <-1,1,0> }
object { Obj rotate <0,0,30> translate <1,1,0> }

#declare Obj2 = box { <-0.5,-0.5,-0.5>, <0.5,0.5,0.5> texture { T0 } }

object { Obj2 translate <-1,-1,0> }
object { Obj2 rotate <0,0,30> translate <1,-1,0> }



Ken wrote in message <36FF5BEE.125FA5AA@pacbell.net>...
>********  Welcome to the world origin concept.  **********
>
>Gordon wrote:
>> Thanks Ken, but I think you may of misunderstood my description. I will
>> illustrate with an example.
>>
>> #declare Fred = mesh{
>> triangle { <1,1,1>, <1,1,1.5>,<1,1.5,1> texture {T0} }
>> triangle { <2,1,1>, <2,1,1.5>,<2,1.5,1> texture {T1} }
>> }
>>
>> object { Fred } // This one is OK
>> object { Fred rotate <0,0,45> } // This one is not the same as the other
>> one! The textures have rotated (I think) 45 degrees the oposite direction
to
>> the mesh.
>>
>> Does this make sense?
>>
>> Gordon
>> <gbe### [at] birdcameroncomau>
>>
>> I
>
>   No I understood you completely. If you take the time to
> render the following example I believe you will find that
> it unquestionably supports my earlier claims. I rearranged
> your two triangle example because your triangle mesh didn't
> have any common vertice locations. The way they are positioned
> now is in keeping with your problem and shows the only method
> I know of to adhere to the present system of a zero origin
> and not have your textures move when translated, rotated, or
> both.
>
>  I am not saying that it is a perfect system but if you adhere
> to it's rules it will perform reliably and predictably.
>
>  camera{location<0,.5,-6>look_at<0,.5,0>}
>
>  light_source{<0,0,-10>rgb 1}
>
>  #declare T1 =
>  texture{ pigment { gradient x+y color_map {
>  [0.00 rgb<1,1,1>][0.40 rgb<1,1,1>][0.40 rgb<1,0,0>]
>  [0.60 rgb<1,0,0>][0.60 rgb<1,1,1>][1.00 rgb<1,1,1>]}scale 0.5}
>  finish{ambient 0.35 diffuse 0.35}}
>
>  // The method you were using
>  #declare Fred1 =
>  mesh     {
>  triangle { <-1,1,0>,<0,0,0>,<1,1,0> texture{T1}}
>  triangle { <-1,1,0>,<0,2,0>,<1,1,0> texture{T1}}
>           }
>
>  // By the book method
>  #declare Fred2 =
>  union    {
>  triangle { <-1, 0.5,0>,<0,-0.5,0>,<1, 0.5,0>texture{T1}translate y*-0.5}
>  triangle { <-1,-0.5,0>,<0, 0.5,0>,<1,-0.5,0>texture{T1}translate y* 0.5}
>           }
>
>  object   { Fred1 rotate  0*y translate < 0.0,-1.75,0> }
>  object   { Fred1 rotate 45*x translate <-2.5,-1.75,0> }
>  object   { Fred1 rotate 65*y translate < 2.5,-1.75,0> }
>
>  object   { Fred2 rotate  0*y translate < 0.0, 1.75,0> }
>  object   { Fred2 rotate 45*x translate <-2.5, 1.75,0> }
>  object   { Fred2 rotate 65*y translate < 2.5, 1.75,0> }
>
>
>Regards,
>
>--
>Ken Tyler
>
>mailto://tylereng@pacbell.net


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.